<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>动态绑定 class属性对象语法</title>
</head>
<script src="../../../../../js/vue.global.js"></script>
<style>
    .colordecroation {
        color: red;
    }
    .linedecoration {
        text-decoration: underline;
    }
</style>

<body>
<div id="app">
    <h1 class="colordecroation">Hello World!</h1>
<!--    对象与噶格式{类名：true}-->
    <h1 class="colordecroation" v-bind:class={linedecoration:true}>Hello World!</h1>
    <h1 v-bind:class="{colordecroation:iscolordecroatio,linedecoration:islinedecoration}">Hello World!</h1>
    <h1 v-bind:class="getClass()">Hello World!</h1>
</div>
</body>
<script>
    const app = Vue.createApp({
        data(){
            return {
                iscolordecroatio:true,
                islinedecoration:true
            }
        },
        methods:{
            getClass(){
                return {colordecroation:this.iscolordecroatio,linedecoration: this.islinedecoration}
            }
        }
    })
    app.mount("#app")
</script>
</html>